package com.gnerv.sylvanas.module.sse.scheduler;

import com.gnerv.sylvanas.module.sse.operation.SseOperationService;
import lombok.AllArgsConstructor;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

@Component
@AllArgsConstructor
public class HeartbeatScheduler {

    private final SseOperationService sseOperationService;

    @Scheduled(fixedRate = 1000 * 30)
    public void SseEmitterHeartbeatScheduler(){
        sseOperationService.heartbeat();
    }

}
